#include <sys/wait.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
void child(int delay) {
    sleep(delay);
    exit(0); 
}

void parent(int *status) {
    wait(status);
}

int main() {
    pid_t pid;
    int status;
    printf("before :my pid is%d\n", getpid());
    pid = fork();
    if (pid == 0) child(1000);
    if (pid > 0) parent(&status);
    return 0; // 补充标准C程序中main函数的返回值
}
